<template>
  <div>
   {{studentId}}
  </div>
</template>

<script>

export default {
  name: 'StudentView',
  data() {
    return {
      studentId: '',
    }
  },
  created(){
    this.getStudentId();
  },
  watch: {
   '$route.params.id': function () {
    this.getStudentId();
}
  },
 methods: {
    getStudentId(){
      const studentid = this.$route.params.id;
      console.log(studentid);
      this.studentId = studentid;
    }
  },
}
</script>